﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq.Expressions;


namespace Pap.Data
{
    /// <summary>
    /// 
    /// </summary>
    public interface IReportRepository
    {
        /// <summary>
        /// Finds the users.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IUser> FindUsers(Expression<Func<IUser, bool>> where);
        /// <summary>
        /// Finds the projects.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IProject> FindProjects(Expression<Func<IProject, bool>> where);
        /// <summary>
        /// Finds the committee.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICommittee> FindCommittee(Expression<Func<ICommittee, bool>> where);
        /// <summary>
        /// Finds the project stage.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IProjectStage> FindProjectStage(Expression<Func<IProjectStage, bool>> where);
        /// <summary>
        /// Finds the social statuses.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<ILookUpEntity> FindSocialStatuses(System.Linq.Expressions.Expression<Func<ILookUpEntity, bool>> Where);
        /// <summary>
        /// Finds the educational levels.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<ILookUpEntity> FindEducationalLevels(System.Linq.Expressions.Expression<Func<ILookUpEntity, bool>> Where);
        /// <summary>
        /// Finds the loan types.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<ILookUpEntity> FindLoanTypes(System.Linq.Expressions.Expression<Func<ILookUpEntity, bool>> Where);
        /// <summary>
        /// Finds the loan places.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<ILookUpEntity> FindLoanPlaces(System.Linq.Expressions.Expression<Func<ILookUpEntity, bool>> Where);
        /// <summary>
        /// Finds the military statuses.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<ILookUpEntity> FindMilitaryStatuses(System.Linq.Expressions.Expression<Func<ILookUpEntity, bool>> where);
        /// <summary>
        /// Finds the loan legal forms.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<ILookUpEntity> FindLoanLegalForms(System.Linq.Expressions.Expression<Func<ILookUpEntity, bool>> where);
        /// <summary>
        /// Finds the users transactions.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IVUsersTransaction> FindUsersTransactions(System.Linq.Expressions.Expression<Func<IVUsersTransaction, bool>> where);
        /// <summary>
        /// Finds the loan steps.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IwfStep> FindLoanSteps(System.Linq.Expressions.Expression<Func<IwfStep, bool>> where);

        /// <summary>
        /// Finds the monthly responsible report.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IVMonthlyResponsibleReport> FindMonthlyResponsibleReport(System.Linq.Expressions.Expression<Func<IVMonthlyResponsibleReport, bool>> where);

        /// <summary>
        /// Finds the monthly accountant data.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IVMonthlyAccountantReport> FindMonthlyAccountantData(System.Linq.Expressions.Expression<Func<IVMonthlyAccountantReport, bool>> where);

        /// <summary>
        /// Finds the waiting list report.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IVWaitingListReport> FindWaitingListReport(System.Linq.Expressions.Expression<Func<IVWaitingListReport, bool>> where);

        /// <summary>
        /// Gets the monthly responsible report.
        /// </summary>
        /// <param name="userID">The user ID.</param>
        /// <param name="projectID">The project ID.</param>
        /// <param name="dateTime">The date time.</param>
        /// <returns></returns>
        IEnumerable GetMonthlyResponsibleReport(Guid userID, Guid projectID, DateTime dateTime);

        /// <summary>
        /// Gets the male percent.
        /// </summary>
        /// <param name="projectID">The project ID.</param>
        /// <param name="dateTime">The date time.</param>
        /// <returns></returns>
        double GetMalePercent(Guid projectID, DateTime dateTime);
        /// <summary>
        /// Gets the exisiting loans percent.
        /// </summary>
        /// <param name="projectID">The project ID.</param>
        /// <param name="dateTime">The date time.</param>
        /// <returns></returns>
        double GetExisitingLoansPercent(Guid projectID, DateTime dateTime);
        /// <summary>
        /// Gets the male activity.
        /// </summary>
        /// <param name="projectID">The project ID.</param>
        /// <param name="dateTime">The date time.</param>
        /// <returns></returns>
        IEnumerable GetMaleActivity(Guid projectID, DateTime dateTime);
        /// <summary>
        /// Gets the activity percents.
        /// </summary>
        /// <param name="projectID">The project ID.</param>
        /// <param name="dateTime">The date time.</param>
        /// <returns></returns>
        IEnumerable GetActivityPercents(Guid projectID, DateTime dateTime);

        /// <summary>
        /// Gets the loan count.
        /// </summary>
        /// <param name="projectID">The project ID.</param>
        /// <param name="dateTime">The date time.</param>
        /// <returns></returns>
        int GetLoanCount(Guid projectID, DateTime dateTime);

        /// <summary>
        /// Gets the union status count of requests.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfRequests(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status count of accepted loan.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfAcceptedLoan(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status count ofrefused loan.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfrefusedLoan(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status count of loan executed.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfLoanExecuted(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status count of loan stopped from execution.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfLoanStoppedFromExecution(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status total amount of executed loans.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        double GetUnionStatusTotalAmountOfExecutedLoans(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status total of repayment without fines.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        double GetUnionStatusTotalOfRepaymentWithoutFines(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status total amount of spent.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        double GetUnionStatusTotalAmountOfSpent(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status total due amount.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        double GetUnionStatusTotalDueAmount(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status the funding from PAP.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        double GetUnionStatusTheFundingFromPAP(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status total fines collected.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        double GetUnionStatusTotalFinesCollected(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status count of terminated payment loans.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfTerminatedPaymentLoans(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status the benefits repayed.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        double GetUnionStatusTheBenefitsRepayed(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status count of loans transfered to court.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfLoansTransferedToCourt(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status repayment percentage.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        double GetUnionStatusRepaymentPercentage(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status count of primary loans.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfPrimaryLoans(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status count of secondary loans.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfSecondaryLoans(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status count of loans that exceed the three stage.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfLoansThatExceedTheThreeStage(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);
        /// <summary>
        /// Gets the union status count of renewal loans.
        /// </summary>
        /// <param name="Projects">The projects.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        int GetUnionStatusCountOfRenewalLoans(List<Guid> Projects, DateTime? FromDate, DateTime? ToDate);

        /// <summary>
        /// Controlthes the movementof usersofthe system.
        /// </summary>
        /// <param name="Committee">The committee.</param>
        /// <param name="UserName">Name of the user.</param>
        /// <param name="LoanNumber">The loan number.</param>
        /// <param name="FromDate">From date.</param>
        /// <param name="ToDate">To date.</param>
        /// <returns></returns>
        IEnumerable ControltheMovementofUsersoftheSystem(Guid Committee, Guid? UserName, int? LoanNumber, DateTime FromDate, DateTime ToDate);

        /// <summary>
        /// Systems the overall.
        /// </summary>
        /// <param name="param">The param.</param>
        /// <returns></returns>
        IEnumerable SystemOverall(SystemOverallParameters param);

        /// <summary>
        /// Finds the total system report.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IVTotalSystemReport> FindTotalSystemReport(System.Linq.Expressions.Expression<Func<IVTotalSystemReport, bool>> where);

    }

    /// <summary>
    /// 
    /// </summary>
    public class SystemOverallParameters
    {
        /// <summary>
        /// Gets or sets the customergender.
        /// </summary>
        /// <value>
        /// The customergender.
        /// </value>
        public CustomerGender customergender { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="SystemOverallParameters"/> is isloanprojectexist.
        /// </summary>
        /// <value>
        ///   <c>true</c> if isloanprojectexist; otherwise, <c>false</c>.
        /// </value>
        public bool isloanprojectexist { get; set; }
        /// <summary>
        /// Gets or sets the educationallevel.
        /// </summary>
        /// <value>
        /// The educationallevel.
        /// </value>
        public Guid educationallevel { get; set; }
        /// <summary>
        /// Gets or sets the project.
        /// </summary>
        /// <value>
        /// The project.
        /// </value>
        public List<Guid> project { get; set; }
        /// <summary>
        /// Gets or sets the projectstage.
        /// </summary>
        /// <value>
        /// The projectstage.
        /// </value>
        public Guid projectstage { get; set; }
        /// <summary>
        /// Gets or sets the socialstatus.
        /// </summary>
        /// <value>
        /// The socialstatus.
        /// </value>
        public Guid socialstatus { get; set; }
        /// <summary>
        /// Gets or sets the loantype.
        /// </summary>
        /// <value>
        /// The loantype.
        /// </value>
        public Guid loantype { get; set; }
        /// <summary>
        /// Gets or sets the loanplacetype.
        /// </summary>
        /// <value>
        /// The loanplacetype.
        /// </value>
        public Guid loanplacetype { get; set; }
        /// <summary>
        /// Gets or sets the committes.
        /// </summary>
        /// <value>
        /// The committes.
        /// </value>
        public List<Guid> committes { get; set; }
        /// <summary>
        /// Gets or sets the responsible.
        /// </summary>
        /// <value>
        /// The responsible.
        /// </value>
        public Guid responsible { get; set; }

        /// <summary>
        /// Gets or sets the boardnumber.
        /// </summary>
        /// <value>
        /// The boardnumber.
        /// </value>
        public int boardnumber { get; set; }
        /// <summary>
        /// Gets or sets the agefrom.
        /// </summary>
        /// <value>
        /// The agefrom.
        /// </value>
        public int agefrom { get; set; }
        /// <summary>
        /// Gets or sets the ageto.
        /// </summary>
        /// <value>
        /// The ageto.
        /// </value>
        public int ageto { get; set; }
        /// <summary>
        /// Gets or sets the familynumberfrom.
        /// </summary>
        /// <value>
        /// The familynumberfrom.
        /// </value>
        public int familynumberfrom { get; set; }
        /// <summary>
        /// Gets or sets the familynumberto.
        /// </summary>
        /// <value>
        /// The familynumberto.
        /// </value>
        public int familynumberto { get; set; }
        /// <summary>
        /// Gets or sets the averageincomefrom.
        /// </summary>
        /// <value>
        /// The averageincomefrom.
        /// </value>
        public int averageincomefrom { get; set; }
        /// <summary>
        /// Gets or sets the averageincometo.
        /// </summary>
        /// <value>
        /// The averageincometo.
        /// </value>
        public int averageincometo { get; set; }
        /// <summary>
        /// Gets or sets the loanpaymentperiod.
        /// </summary>
        /// <value>
        /// The loanpaymentperiod.
        /// </value>
        public int loanpaymentperiod { get; set; }
        /// <summary>
        /// Gets or sets the loanexecutioamount.
        /// </summary>
        /// <value>
        /// The loanexecutioamount.
        /// </value>
        public double loanexecutioamount { get; set; }

        /// <summary>
        /// Gets or sets the loanexecutiondatefrom.
        /// </summary>
        /// <value>
        /// The loanexecutiondatefrom.
        /// </value>
        public DateTime loanexecutiondatefrom { get; set; }
        /// <summary>
        /// Gets or sets the loanexecutiondateto.
        /// </summary>
        /// <value>
        /// The loanexecutiondateto.
        /// </value>
        public DateTime loanexecutiondateto { get; set; }
        /// <summary>
        /// Gets or sets the repaymentterminationdatefrom.
        /// </summary>
        /// <value>
        /// The repaymentterminationdatefrom.
        /// </value>
        public DateTime repaymentterminationdatefrom { get; set; }
        /// <summary>
        /// Gets or sets the repaymentterminationdateto.
        /// </summary>
        /// <value>
        /// The repaymentterminationdateto.
        /// </value>
        public DateTime repaymentterminationdateto { get; set; }
        /// <summary>
        /// Gets or sets the requestdatefrom.
        /// </summary>
        /// <value>
        /// The requestdatefrom.
        /// </value>
        public DateTime requestdatefrom { get; set; }
        /// <summary>
        /// Gets or sets the requestdateto.
        /// </summary>
        /// <value>
        /// The requestdateto.
        /// </value>
        public DateTime requestdateto { get; set; }
        /// <summary>
        /// Gets or sets the boarddatefrom.
        /// </summary>
        /// <value>
        /// The boarddatefrom.
        /// </value>
        public DateTime boarddatefrom { get; set; }
        /// <summary>
        /// Gets or sets the boarddateto.
        /// </summary>
        /// <value>
        /// The boarddateto.
        /// </value>
        public DateTime boarddateto { get; set; }

        /// <summary>
        /// Gets or sets the job.
        /// </summary>
        /// <value>
        /// The job.
        /// </value>
        public string job { get; set; }
        /// <summary>
        /// Gets or sets the reasonofrefuse.
        /// </summary>
        /// <value>
        /// The reasonofrefuse.
        /// </value>
        public string reasonofrefuse { get; set; }

    }

}
